package cn.zhl.tool;


/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2020-03-27 10:35
 **/
public class TimeTool {
	public static void showTime(String name, Task task) {
		System.out.println("开始" + name + "的时间测试");
		Long start = System.currentTimeMillis();
		task.execute();
		Long end = System.currentTimeMillis();
		System.out.println("耗时:" + (end - start) / 1000.0 + "秒");
	}

	public interface Task {
		void execute();
	}
}
